function browserRedirect() {
    var sUserAgent = navigator.userAgent.toLowerCase();
    var bIsIpad = sUserAgent.match(/ipad/i) == "ipad";
    var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os";
    var bIsMidp = sUserAgent.match(/midp/i) == "midp";
    var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";
    var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb";
    var bIsAndroid = sUserAgent.match(/android/i) == "android";
    var bIsCE = sUserAgent.match(/windows ce/i) == "windows ce";
    var bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile";
    console.log("您的浏览设备为：");
    if (bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM) {4
        console.log("phone");
        return "phone";
        
    } else {
        console.log("pc");
        return "pc";
    }
}

if(browserRedirect() == "pc"){
    document.onkeydown=function(event){
        var e = event || window.event || arguments.callee.caller.arguments[0];
        if(e && e.keyCode==37){ // 按 方向左 
            console.log("左"); 
            fx(1);
        }
        if(e && e.keyCode==39){ // 按 方向右 
            console.log("右"); 
            fx(2);
        }
        if(e && e.keyCode==38){ // 按 方向上 
            console.log("上"); 
            fx(3);
        }
        if(e && e.keyCode==40){ // 按 方向下 
            console.log("下"); 
            fx(4);
        }
    }
}